import 'dart:ui';

import 'package:flutter_lui/src/l_utils.dart';

export 'src/l_badges.dart';
export 'src/l_box.dart';
export 'src/l_button.dart';
export 'src/l_carousel.dart';
export 'src/l_checkbox.dart';
export 'src/l_circle_button_tabbar.dart';
export 'src/l_color_Print.dart';
export 'src/l_day.dart';
export 'src/l_dialog.dart';
export 'src/l_divider.dart';
export 'src/l_events.dart';
export 'src/l_image.dart';
export 'src/l_input.dart';
export 'src/l_loading_mask.dart';
export 'src/l_navigation_bar.dart';
export 'src/l_navigator_observer.dart';
export 'src/l_password_grid.dart';
export 'src/l_picker.dart';
export 'src/l_popover.dart';
export 'src/l_post_frame_info.dart';
export 'src/l_progress.dart';
export 'src/l_radio.dart';
export 'src/l_rich_text.dart';
export 'src/l_scroll_wheel.dart';
export 'src/l_store.dart';
export 'src/l_switch.dart';
export 'src/l_text.dart';
export 'src/l_toast.dart';
export 'src/l_utils.dart';

/// 通用类型 一般代表颜色显示
enum LUIType {
  primary,
  success,
  warning,
  danger,
}

class LUI {
  /// 主色调
  Color primaryColor = const Color(0xFF165DFF);

  /// 成功色调
  Color successColor = const Color(0xFF00B42A);

  /// 警告色调
  Color warningColor = const Color(0xFFFF7D00);

  /// 危险色调
  Color dangerColor = const Color(0xFFF53F3F);

  /// 默认文字颜色
  Color textColor = const Color(0xFF333333);

  /// 辅助文字颜色
  Color color9 = const Color(0xff999999);

  /// 次要文字颜色
  Color color6 = const Color(0xff666666);

  /// 默认边框颜色
  Color borderColor = const Color(0xffe5e5e5);

  /// 默认组件背景色 开关 进度条 胶囊tabbar
  Color backgroundColor = const Color(0xffefefef);

  double dialogMaskOpacity = 0.7;

  /// 默认字号大小 在baseDesignWidth设计图尺寸下的大小
  double fontSize = 12;

  /// 默认圆角大小 在baseDesignWidth设计图尺寸下的大小
  double radius = 4;

  /// 设计图宽度
  int baseDesignWidth = 375;

  static LUI instance = LUI._();
  LUI._();

  init({
    int? designWidth,
    Color? primaryColor,
    Color? successColor,
    Color? warningColor,
    Color? dangerColor,
    Color? textColor,
    double? fontSize,
    double? radius,
    Color? backgroundColor,
    double? dialogMaskOpacity,
    Color? borderColor,
  }) {
    if (designWidth != null) {
      baseDesignWidth = designWidth;
      PageSize.baseScreenWidth = designWidth;
      PageSize.sizeRatio = PageSize.width / designWidth;
    }
    if (radius != null) this.radius = radius;
    if (primaryColor != null) this.primaryColor = primaryColor;
    if (successColor != null) this.successColor = successColor;
    if (warningColor != null) this.warningColor = warningColor;
    if (dangerColor != null) this.dangerColor = dangerColor;
    if (textColor != null) this.textColor = textColor;
    if (fontSize != null) this.fontSize = fontSize;
    if (backgroundColor != null) {
      this.backgroundColor = backgroundColor;
    }

    if (dialogMaskOpacity != null) {
      this.dialogMaskOpacity = dialogMaskOpacity;
    }
    if (borderColor != null) {
      this.borderColor = borderColor;
    }
  }
}
